import { Provide } from '@midwayjs/core';
import { Idle } from '../../entity/user/idle';
import { InjectEntityModel } from '@midwayjs/orm';
import { Repository } from 'typeorm';


@Provide()
export class IdleService {

    @InjectEntityModel(Idle)
    idleModel: Repository<Idle>

    async getidle(): Promise<Idle[]> {
        try {
            const result = await this.idleModel.find()
            console.log("result", result);
            return result
        } catch (err) {
            console.log("err", err);
        }
    }

    async deleteidle(id) {
        try {
            const result = await this.idleModel.delete(id)
            return result
        } catch (err) {
            console.log("err", err);
        }
    }


}
